#pragma once

#include "Affix.h"

#include <vector>
using std::vector;

class LevelAffixes {
	friend class ItemType;
public:
	LevelAffixes(LevelAffixes* prev = NULL, vector<const Affix*> initAffixes = vector<const Affix*>());
	unsigned long totalSize() const;
	unsigned long levelSize() const;
	bool addAffix(const Affix* newAffix);
	bool addAffixes(vector<const Affix*> newAffixes);

	class Iterator : public vector<const Affix*>::iterator {
		friend class LevelAffixes;
	public:
		Iterator(const LevelAffixes* LevAff, bool LtEq = true);
		LevelAffixes::Iterator& LevelAffixes::Iterator::operator = (vector<const Affix*>::const_iterator right);
		LevelAffixes::Iterator& operator++();
		LevelAffixes::Iterator& operator++(int);
		LevelAffixes::Iterator& start();
		bool isEnd() const;
	private:
		const LevelAffixes* baseLevel;
		const LevelAffixes* currLevel;
		bool calcLevelLtEq;
		bool end;
	};
private:
	vector<const Affix*> affixes;
	LevelAffixes* previous;
};
